home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / othergnu / trmcap10.zoo / configur < prev    next >
Text File  |  1992-05-03  |  6KB  |  183 lines

  1. # Guess values for system-dependent variables and create Makefiles.
  2. # Generated automatically by autoconf.
  3. # Copyright (C) 1991 Free Software Foundation, Inc.
  4.  
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2, or (at your option)
  8. # any later version.
  9.  
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14.  
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [TARGET]
  20. # All args except --srcdir=DIR are ignored.
  21.  
  22. trap '/bin/rm.ttp -f conftest conftest.c; exit 1' 1 3 15
  23.  
  24. set +u # Make sure unset variables are ok.
  25.  
  26. for arg in $*; do
  27.   # Handle --srcdir with a space before the argument.
  28.   if test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   else
  32.     case $arg in
  33.      +srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  34.     srcdir=`echo $arg | /bin/sed.ttp 's/[+-]*s[a-z]*=//'` ;;
  35.      +srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  36.     next_srcdir=yes ;;
  37.      +host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  38.      +host | --host | --hos | --ho | --h)
  39.     next_host=yes ;;
  40.      +gas | --gas | --ga | --g) ;;
  41.      +nfp | --nfp | --nf | --n) ;;
  42.      *) ;;
  43.     esac
  44.   fi
  45. done
  46.  
  47. INCLUDEDIR=${INCLUDEDIR-/usr/include}
  48.  
  49. /bin/rm.ttp -f conftest conftest.c
  50. compile='$CC $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  51.  
  52. # A filename unique to this package, relative to the directory that
  53. # configure is in, which we can look for to find out if srcdir is correct.
  54. unique_file=termcap.h
  55.  
  56. # Makefile rules whose targets are searched for in VPATH need to use $<.
  57. # However, old makes do not support it, so we use a combination
  58. # construction in Makefile.in: `$file<'.
  59. # If srcdir is `.', we use sed to change that to `file' for old makes.
  60. # Otherwise, we use sed to change it to `$<'.
  61. # vpsub is the sed program, which changes `$file<' to one or the other.
  62. vpsub='s,\$\([-./a-zA-Z0-9_]*\)<,\1,g'
  63. # srsub changes `@srcdir@' in Makefile.in into either `.' or the path
  64. # of the top of the source tree for the package.
  65. srsub='s,@srcdir@[-./a-zA_Z0-9_]*,.,'
  66.  
  67. # Find the source files, if location was not specified.
  68. if test x$srcdir = x; then
  69.   srcdirdefaulted=yes; srcdir=.
  70.   if test ! -r $unique_file; then srcdir=..; fi
  71. fi
  72. if test ! -r $srcdir/$unique_file; then
  73.   if test x$srcdirdefaulted = xyes; then
  74.     echo "configure: Can not find sources in \`.' or \`..'." 1>&2
  75.   else
  76.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  77.   fi
  78.   exit 1
  79. fi
  80. if test $srcdir != .; then
  81.   VPATH='VPATH = $(srcdir)'
  82.   case $srcdir in
  83.     /*|~*) ;;
  84.     *) srcdir=`pwd`/$srcdir ;; # Make relative path absolute.
  85.   esac
  86.   vpsub='s,\$\([-./a-zA-Z0-9_]*\)<,\$<,g'
  87.   srsub="s,@srcdir@,$srcdir,"
  88. fi
  89.  
  90.  
  91. # The Bourne shell writes "command not found" to /dev/tty, so if we get
  92. # a usage message on stderr, we have the program.
  93. #
  94. # ksh and zsh write "command not found" to stderr, but test -n does not
  95. # want any output if there is no program.  So we use the `type' builtin
  96. # instead for them (and bash).
  97. if test "$RANDOM" = "$RANDOM"; then
  98.   checkfor='test -n "`$checkprog $checkargs 2>&1`"'
  99. else
  100.   checkfor='type $checkprog >/dev/null'
  101. fi
  102.  
  103. echo checking for gcc
  104. checkprog=gcc checkargs=''
  105. test -z "$CC" && eval $checkfor && CC='gcc -O'
  106. CC=${CC-cc}
  107.  
  108. echo checking for install
  109. # Make sure to not get the incompatible SysV /etc/install.
  110. if test -z "$INSTALL" || test -z "$INSTALLDATA"; then
  111.   saveifs="$IFS"; IFS="$IFS:"
  112.   for dir in $PATH; do
  113.     test -z "$dir" && dir=.
  114.     if test $dir != /etc && test -f $dir/install; then
  115.       test -z "$INSTALL" && INSTALL="$dir/install -c"
  116.       test -z "$INSTALLDATA" && INSTALLDATA="$dir/install -c -m 644"
  117.       break
  118.     fi
  119.   done
  120.   IFS="$saveifs"
  121. fi
  122. INSTALL=${INSTALL-cp}
  123. INSTALLDATA=${INSTALLDATA-cp}
  124.  
  125. echo checking for BSD string and memory functions
  126. echo "#include <strings.h>
  127. main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c
  128. eval $compile
  129. if test -s conftest && ./conftest 2>/dev/null; then :
  130. else
  131.   DEFS="$DEFS -DUSG"
  132. fi
  133. /bin/rm.ttp -f conftest conftest.c
  134.  
  135. echo checking whether the address of an argument can be used as an array
  136. echo 'main() {
  137. /* Return 0 iff arg arrays are ok.  */
  138. exit(!x(1, 2, 3, 4));
  139. }
  140. x(a, b, c, d) {
  141.   return y(a, &b);
  142. }
  143. /* Return 1 iff arg arrays are ok.  */
  144. y(a, b) int *b; {
  145.   return a == 1 && b[0] == 2 && b[1] == 3 && b[2] == 4;
  146. }' > conftest.c
  147. eval $compile
  148. ./conftest || DEFS="$DEFS -DNO_ARG_ARRAY"
  149. /bin/rm.ttp -f conftest conftest.c uttest core
  150.  
  151. trap 'for dir in .; do /bin/rm.ttp -f $dir/Makefile; done; /bin/rm.ttp -f config.status; exit 1' 1 3 15
  152.  
  153. for dir in .; do
  154.   test -d $dir || mkdir $dir
  155.   echo creating $dir/Makefile
  156.   echo '# Generated automatically from Makefile.in by configure.' > $dir/Makefile
  157.   /bin/sed.ttp -e "
  158. $vpsub
  159. $srsub
  160. s,@VPATH@,$VPATH,
  161. s,@DEFS@,$DEFS,
  162. s,@LIBS@,$LIBS,
  163. s,@PROGS@,$PROGS,
  164. s,@CC@,$CC,
  165. s,@INSTALL@,$INSTALL,
  166. s,@INSTALLDATA@,$INSTALLDATA,
  167. " $srcdir/$dir/Makefile.in >> $dir/Makefile
  168. # Prevent GNU make 3 from overflowing arg limit on SysV.
  169. echo "
  170. .NOEXPORT:" >> $dir/Makefile
  171. done
  172.  
  173. echo creating config.status
  174. echo "\
  175. DEFS=\"$DEFS\"
  176. LIBS=\"$LIBS\"
  177. PROGS=\"$PROGS\"
  178. CC=\"$CC\"
  179. INSTALL=\"$INSTALL\"
  180. INSTALLDATA=\"$INSTALLDATA\"
  181. " > config.status
  182.  
  183.